package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("task_file")
@Schema(description = "任务用户关系表")
public class TaskFile extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "id")
    private String id;

    @Schema(description = "文件名")
    @TableField("file_name")
    @JsonProperty("fileName")
    private String fileName;

    @Schema(description = "文件名")
    @TableField("file_name_up")
    @JsonProperty("fileNameUp")
    private String fileNameUp;

    @Schema(description = "文件类型")
    @TableField("file_type")
    @JsonProperty("fileType")
    private String fileType;

    @Schema(description = "任务id")
    @TableField("task_id")
    @JsonProperty("taskId")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long taskId;

    @Schema(description = "文件大小")
    @TableField("file_size")
    @JsonProperty("fileSize")
    private Double fileSize;

    @Schema(description = "服务器地址")
    @TableField("server_ip")
    @JsonProperty("serverIp")
    private String serverIp;

    @Schema(description = "文件路径")
    @TableField("file_path")
    @JsonProperty("filePath")
    private String filePath;

    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
